package com.cn.mapper;

import com.cn.pojo.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface GoodsMapper {
    List<IndexGoods> NewProductLaunch(@Param("number") int number);

    Goods searchGoodsDetail(@Param("id") int id);

    int addToCart(@Param("userId") int userId, @Param("goodsId") int goodsId);

    List<ShoppingCartItem> searchCartInfo(@Param("userId") int userId);

    int deleCart(@Param("goodsId") int goodsId);

    int updateCartNum(@Param("num") int num, @Param("goodsId") int goodsId);

    List<Goods> searchGoods(@Param("info") String info);

    List<Category> searchCategory();
    List<Category> searchCategory2();

    List<Goods> searchGoodsByCategory(@Param("categoryId") int categoryId);

    List<OrderItem> searchOrderItem(@Param("userId") int userId);


    List<Carousel> carousel();

    List<Goods> findAll();

    void updateStatus(@Param("status") int status, @Param("id") int id);

    void updateCarousel(@Param("id") int id);

    List<IndexGoods> findIndexConfig(@Param("id") int id);

    ShoppingCartItem findCartItem(@Param("userId") int userId, @Param("goodsId") int goodsId);

    void addNum(@Param("itemId") int itemId);

    int addCarousel(@Param("carousel") Carousel carousel);

    int addGoods(@Param("goods") Goods goods);

    int editGoods(@Param("goods") Goods goods);

    int deleIndexConfigs(@Param("configId") int configId);

    IndexGoods findByConfigId(@Param("configId") int configId);

    void addIndexGoods(@Param("indexGoods") IndexGoods indexGoods);

    void updateIndexGoods(@Param("indexGoods") IndexGoods indexGoods);

    Category findCategory(@Param("categoryId") int categoryId);
    void addCategory(@Param("category") Category category);
    void editCategory(@Param("category") Category category);
    void deleCategory(@Param("categoryId") int categoryId);
}